home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 2 / ETO Development Tools 2.iso / Tools - Objects / MacApp / MacApp CD Release / MacApp 2.0.1 (Many Libraries) / Interfaces / CIncludes / UViewCoords.h < prev   
Encoding:
C/C++ Source or Header  |  1990-10-25  |  3.7 KB  |  94 lines  |  [TEXT/MPS ]

  1. /*[a-,body+,h-,o=100,r+,rec+,t=4,u+,#+,j=20/57/1$,n-]*/
  2. /* UViewCoords.p */
  3. /* Copyright © 1987-1990 by Apple Computer, Inc.  All rights reserved. */
  4. #ifndef  __UVIEWCOORDS__
  5. #define __UViewCoords__  0
  6. #endif
  7. #if  ! __UViewCoords__
  8. #define __UViewCoords__  1
  9.  
  10.         /* • Auto-Include the requirements for this unit's interface. */
  11. #ifndef  __UMacAppUtilities__
  12. #include "UMacAppUtilities.h"
  13. #endif
  14.  
  15. const short kMaxCoord            = 30000;
  16.    /* largest possible QuickDraw view coordinate
  17.                                                          (QuickDraw maximum minus slop for size of
  18.                                                          screen) */
  19.  
  20.             /* Calculations with VPoints */
  21.  
  22. extern pascal void PtToVPt(Point thePt, VPoint *theVPt);
  23.         /* Convert a QD Point to a VPoint. */
  24.  
  25. extern pascal Point VPtToPt(VPoint *theVPt);
  26.         /* Convert a VPoint to a QD Point. */
  27.  
  28. extern pascal void AddVPt(VPoint *srcVPt, VPoint *dstVPt);
  29.         /* Adds the coordinates of 'srcVPt' to the coordinates of 'dstVPt' returning result in
  30.         'dstVPt'. */
  31.  
  32. extern pascal void SubVPt(VPoint *srcVPt, VPoint *dstVPt);
  33.         /* Subtracts the coordinates of 'srcVPt' from the coordinates of 'dstVPt' returning resu
  34.            lt in
  35.         'dstVPt'. */
  36.  
  37. extern pascal void SetVPt(VPoint *vPt, VCoordinate h, VCoordinate v);
  38.         /* Assigns the two given coordinates to 'vPt'. */
  39.  
  40. extern pascal Boolean EqualVPt(VPoint *pt1, VPoint *pt2);
  41.         /* Compares the two VPoints returning TRUE if they are equal and FALSE if not. */
  42.  
  43.         /* Calculations with VRects */
  44.  
  45. extern pascal void RectToVRect(Rect *theRect, VRect *theVRect);
  46.         /* Converts a QD Rect to a VRect. */
  47.  
  48. extern pascal void VRectToRect(VRect *theVRect, Rect *theRect);
  49.         /* Converts a VRect to a QD Rect. */
  50.  
  51. extern pascal void SetVRect(VRect *r, VCoordinate left, VCoordinate top, VCoordinate right, 
  52.    VCoordinate bottom);
  53.         /* Sets the boundary coordinates of the VRect 'r' . */
  54.  
  55. extern pascal void OffsetVRect(VRect *r, VCoordinate dh, VCoordinate dv);
  56.         /* Moves the given VRect by adding 'dh' to each horizontal and 'dv' to each vertical
  57.         coordinate. Postive values cause the movement to be to the right and down, while negative
  58.         are the opposite. */
  59.  
  60. extern pascal void InsetVRect(VRect *r, VCoordinate dh, VCoordinate dv);
  61.         /* Shrinks or expands the given VRect.The left and right sides are moved in by 'dh', the top
  62.         and bottom by 'dv'. If the values are negative the movement is outward. */
  63.  
  64. extern pascal Boolean PtInVRect(VPoint *pt, VRect *r);
  65.         /* Determines whether the pixel below and to the right of the given coordinate is enclos
  66.            ed by
  67.         the specified VRect, returns TRUE if so or FALSE if not. */
  68.  
  69. extern pascal Boolean SectVRect(VRect *src1, VRect *src2, VRect *dstRect);
  70.         /* Calculates the VRect that is the intersection of the two given VRects, returns TRUE i
  71.            f they
  72.         intersect and FALSE if not. */
  73.  
  74. extern pascal Boolean EmptyVRect(VRect *r);
  75.         /* Returns TRUE if the given VRect is an empty VRect, FALSE if not. */
  76.  
  77. extern pascal Boolean EqualVRect(VRect *rectA, VRect *rectB);
  78.         /* Compares the two given VRects and returns TRUE if they are equal FALSE if not. */
  79.  
  80. extern pascal VCoordinate LengthVRect(VRect *r, VHSelect vhs);
  81.         /* Returns the length of the given VRect in the direction determined by 'vhs'. */
  82.  
  83. extern pascal void PinVRect(VRect *r, VPoint *pt);
  84.         /* Pins the given VPoint to the given VRect. */
  85.  
  86. extern pascal void UnionVRect(VRect *src1, VRect *src2, VRect *dstRect);
  87.         /* Calculates the smallest VRect that encloses both the given VRects, returns the result in
  88.         'dstRect'. */
  89.  
  90. extern pascal void Pt2VRect(VPoint *topLeft, VPoint *botRight, VRect *dstRect);
  91.         /* Returns the smallest VRect that  encloses to given VPoints. */
  92. #endif
  93.  
  94.